<template>
  <div class="fenlei">
    
      <h3 class="title">刘诗茵</h3>
  <!-- 搜索 -->
  <div class="search">
    <div class="search-item">
      <van-icon name="search" value="" class="search-icon"></van-icon>
      <span class="search-text">搜索</span>
   </div>
  </div>

<!-- 主体部分 -->
<div class="main">
    <!-- 左侧 -->
    <div class="main-left">
       <SlideBar @emitData="getData"></SlideBar>
      
    </div>

<!-- 右侧 -->
    <div class="main-right">
    <GoodsList :fenLeiList='fenLeiList'></GoodsList>
    </div>
</div>

<ul class="footer">
    <li>
        <a href="#">
        <p>
       <van-icon name="wap-home-o" size="40"/>
        </p>
      首页
       </a> 
    </li>
    <li>
        <a href="#" class="colors">
        <p>
       <van-icon name="apps-o" size="40" color="red"/>
        </p>
      分类
       </a> 
    </li>
    <li>
        <a href="#">
        <p>
    <van-icon name="shopping-cart-o" size="40" />
        </p>
      购物车
       </a> 
    </li>
    <li>
        <a href="#">
        <p>
      <van-icon name="contact" size="40"/>
        </p>
        我的
       </a> 
    </li>
</ul>



  </div>
</template>

<script>
import SlideBar from '../components/fenlei/SlideBar.vue'
import GoodsList from '../components/fenlei/GoodsList.vue'
export default {
  name:"Fenlei",
  components:{
      SlideBar,
      GoodsList
  },
  data(){
    return {
     fenLeiList:[]
    }
  },
  methods:{
    getData(v){
      this.fenLeiList=v.children
     console.log(v);
    }
  }
}
</script>

<style scoped lang="less">
.title{
   width: 100vw;
   height: 48px;
   background: #eb4450;
   color: #fff;
   text-align: center;
   line-height: 50px;
}
.search{
background: #ed4450;
height: 40px;
width: 100vw;
padding: 10px 0px 0px;
.search-item{
    width: 90vw;
    margin: 0 auto;
    height: 30px;
    background: #fff;
    text-align: center;
    color: #999;
    line-height: 30px;
    border-radius: 3px;
    .search-icon{}
    .search-text{}
     }
  
}

.main{
  width: 100vw;
  height: calc(100vh - 100px);
  display: flex;
  .main-left{
    width: 100px;
    height: 100%;
  }
  .main-right{
    flex: 1;
     height: 100%;
  
  }
}
.footer{
   width: 100%;
   height: 100px;
   position:fixed;
   bottom: 0;
   background: #fff;
   display: flex;
   justify-content: space-around;
   align-items: center;
  border-top:1px solid rgb(167, 148, 148)

}
.footer li .colors{
    color:#ed4450
}
.footer li a{
   color:#333;
    font-size: 18px;
    margin-left: 10px;
}
</style>